export async function init() {
    // 为表格中的查看按钮添加点击事件
    const viewButtons = document.querySelectorAll('.btn-view');
    viewButtons.forEach(button => {
        button.addEventListener('click', function (e) {
            e.stopPropagation();
            alert('将打开公文详情页');
        });
    });

    // 为表格行添加点击事件
    const tableRows = document.querySelectorAll('.recent-table tbody tr');
    tableRows.forEach(row => {
        row.addEventListener('click', function () {
            alert('将打开公文详情页');
        });
    });

    const index = await import('./index.js');

    const quickCards = document.querySelectorAll('.quick-card');
    quickCards.forEach(card => {
        card.addEventListener('click', function () {
            const page = this.getAttribute('data-page');
            const id = this.getAttribute('data-id');
            if(!id){
                alert("开发中,暂无相关信息！");
                return;
            }
            index.loadContent(page, id)
        });
    });
}